var api = require("../../api.js"),
  app = getApp();
const { $Toast } = require('../../iview-weapp/base/index');
Page({
  /** 页面的初始数据 */
  data: {
    question_title_1: '1）、您的企业目前急需要解决的问题有哪些？',
    question_1: [{
        id: 1,
        name: '开展新项目',
      },
      {
        id: 2,
        name: '调整商业模式'
      },
      {
        id: 3,
        name: '拓展业务渠道'
      }, {
        id: 4,
        name: '拓展融资渠道',
      }
    ],
    question_title_2: '2）、您对以下哪些热点问题更感兴趣？',
    question_2: [{
        id: 1,
        name: '创新盈利模式',
      },
      {
        id: 2,
        name: '资本营作与投融策略'
      },
      {
        id: 3,
        name: '互联网营销'
      },
      {
        id: 4,
        name: '销售管理',
      }
    ],
    /** 选中的选项 */
    q_1_current: [],
    q_2_current: [],



    question_title_3: '3）、您的企业品牌现状？',
    question_3: [{
        id: 1,
        name: '创新盈利模式',
      },
      {
        id: 2,
        name: '资本营作与投融策略'
      },
      {
        id: 3,
        name: '互联网营销'
      },
      {
        id: 4,
        name: '销售管理',
      }
    ],
    question_title_4: '4）、您的企业品牌观念？',
    question_4: [{
        id: 1,
        name: '具有品牌战略实施的紧迫感',
      },
      {
        id: 2,
        name: '品牌战略概念模糊'
      },
      {
        id: 3,
        name: '不知从何着手'
      }
    ],
    question_title_5: '5）、您的品牌战略期许？',
    question_5: [{
        id: 1,
        name: '打造品牌知名度',
      },
      {
        id: 2,
        name: '扩充市场占有率'
      },
      {
        id: 3,
        name: '建立新品牌'
      },
      {
        id: 4,
        name: '其它'
      }
    ],
    question_title_6: '6）、您要做的品牌类别？',
    question_6: [{
        id: 1,
        name: '食用饮料业品牌',
      },
      {
        id: 2,
        name: '日用化工业品牌'
      },
      {
        id: 3,
        name: '汽车机械业品牌'
      },
      {
        id: 4,
        name: '商业品牌'
      },
      {
        id: 5,
        name: '服务业品牌',
      },
      {
        id: 6,
        name: '女装品牌'
      },
      {
        id: 7,
        name: '其他服装品牌'
      },
      {
        id: 8,
        name: '网络信息业品牌'
      }
    ],
    question_title_7: '7）、您希望的品牌个性？',
    question_7: [{
        id: 1,
        name: '真诚',
      },
      {
        id: 2,
        name: '刺激'
      },
      {
        id: 3,
        name: '强壮'
      },
      {
        id: 4,
        name: '教养'
      },
      {
        id: 4,
        name: '能力'
      }
    ],
    question_title_8: '8）、以下品牌传播方式，您更青睐的是？',
    question_8: [{
        id: 1,
        name: '用户传播',
      },
      {
        id: 2,
        name: '广告策划'
      },
      {
        id: 3,
        name: '公关策划'
      },
      {
        id: 4,
        name: '促销策划'
      },
      {
        id: 4,
        name: '媒介传播'
      },
      {
        id: 4,
        name: '整合传播'
      }
    ],
    question_title_9: '9）、您需要的品牌服务？',
    question_9: [{
        id: 1,
        name: '品牌定位',
      },
      {
        id: 2,
        name: '品牌形象建立'
      },
      {
        id: 3,
        name: '品牌形象整合传播'
      },
      {
        id: 4,
        name: '品牌维护'
      }
    ],
    question_title_10: '10）、您的品牌服务预算？',
    question_10: [{
        id: 1,
        name: '10万以内',
      },
      {
        id: 2,
        name: '50万以内'
      },
      {
        id: 3,
        name: '100万以内'
      },
      {
        id: 4,
        name: '500万以内'
      }
    ],

    q_3_current: '',
    q_4_current: '',
    q_5_current: '',
    q_6_current: '',
    q_7_current: '',
    q_8_current: '',
    q_9_current: '',
    q_10_current: '',
    /** 答案 */
    current_data: [],
    loading:false
  },
  checked_change_1: function ({
    detail = {}
  }) {
    const index = this.data.q_1_current.indexOf(detail.value);
    index === -1 ? this.data.q_1_current.push(detail.value) : this.data.q_1_current.splice(index, 1);
    this.setData({
      q_1_current: this.data.q_1_current
    });
  },
  checked_change_2: function ({
    detail = {}
  }) {
    const index = this.data.q_2_current.indexOf(detail.value);
    index === -1 ? this.data.q_2_current.push(detail.value) : this.data.q_2_current.splice(index, 1);
    this.setData({
      q_2_current: this.data.q_2_current
    });
  },
  radio_change: function (e) {
    console.log(e)
    let item = e.currentTarget.dataset.current;
    this.setData({
      [item]: e.detail.value,
    });
  },

  ok_click:function(){
    this.setData({ loading:true });
    setTimeout(() => {
      this.setData({ loading:false });
      $Toast({
        content: '表单提交成功',
        type: 'success'
      });
      console.log('提交信息')
      /** 跳转到服务申请页面 */
      wx.navigateTo({
        url: "../service_appoint/service_appoint"
      });
      
    }, 2000);
    
  }

});